Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slices without reflect #12

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Slices without reflect #12

wants to merge 2 commits into from

Conversation

potuz
Copy link
Collaborator

@potuz potuz commented May 10, 2023

This PR changes the assembly code to receive pointers to the first bytes of the slices instead of the slices themselves. This allows the Go binding to simply pass pointers to the first byte and be able to expose functions that take either [][32]byte or []byte.

The generic fallback does copy chunks and digests in the case of byte slice arguments.

This PR changes the assembly code to receive pointers to the first bytes
of the slices instead of the slices themselves. This allows the Go
binding to simply pass pointers to the first byte and be able to expose
functions that take either `[][32]byte` or `[]byte`.

The generic fallback does copy chunks and digests in the case of byte
slice arguments.
@elee1766
Copy link

elee1766 commented May 16, 2023

https://github.com/ledgerwatch/erigon/actions/runs/4987214900/jobs/8928757394 - the hashes aren't matching up here with this pr.
one failing test is here, https://github.com/ledgerwatch/erigon/blob/devel/cl/phase1/core/state/ssz_test.go#L21-L33

the data is in the tests directory (go embedded)

i can try to test take_slices branch later if needed, it is sorta annoying to do because it gets rid of the original function (which we are using elsewhere in code)

@potuz
Copy link
Collaborator Author

potuz commented May 16, 2023

https://github.com/ledgerwatch/erigon/actions/runs/4987214900/jobs/8928757394 - the hashes aren't matching up here with this pr. one failing test is here, https://github.com/ledgerwatch/erigon/blob/devel/cl/phase1/core/state/ssz_test.go#L21-L33

the data is in the tests directory (go embedded)

i can try to test take_slices branch later if needed, it is sorta annoying to do because it gets rid of the original function (which we are using elsewhere in code)

Does that test pass with gohashtree in any way? this PR passes unit tests here hashing, it's hard for me to check against Erigon's test setup, if you can give me a minimum reproducible test that would help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants